package com.rupeng.service;

import java.util.List;

import com.rupeng.annotation.RupengCacheable;
import com.rupeng.annotation.RupengUseCache;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.rupeng.pojo.Card;
import com.rupeng.pojo.CardSubject;
import com.rupeng.pojo.Subject;

@Service
@RupengCacheable
public class CardSubjectService extends ManyToManyBaseService<CardSubject, Card, Subject> {
	public void order(Long[] cardSubjectIds, Integer[] seqNums) {
		if (cardSubjectIds != null) {
			for (int i = 0; i < cardSubjectIds.length; i++) {
                Long cardSubjectId = cardSubjectIds[i];
                Integer seqNum = seqNums[i];

                CardSubject cardSubject = selectOne(cardSubjectId);
                cardSubject.setSeqNum(seqNum);

                update(cardSubject);
            }
        }
	}
}
